package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2017/7/31.
 */
@Entity
@Table(name = "l2r_ipms2_account_type")
@DynamicInsert
public class L2RIpms2AccountType extends BaseEntity{
    private Long hotelId;
    private Long hotelGroupId;
    private String l2RAccountType;
    private String pmsAccountType;
    private String descript;
    private String descriptEn;

    @Basic
    @Column(name = "hotel_id", nullable = false)
    public Long getHotelId() {
        return hotelId;
    }

    public void setHotelId(Long hotelId) {
        this.hotelId = hotelId;
    }

    @Basic
    @Column(name = "hotel_group_id", nullable = false)
    public Long getHotelGroupId() {
        return hotelGroupId;
    }

    public void setHotelGroupId(Long hotelGroupId) {
        this.hotelGroupId = hotelGroupId;
    }

    @Basic
    @Column(name = "l2r_account_type", nullable = true, length = 20)
    public String getL2RAccountType() {
        return l2RAccountType;
    }

    public void setL2RAccountType(String l2RAccountType) {
        this.l2RAccountType = l2RAccountType;
    }

    @Basic
    @Column(name = "pms_account_type", nullable = true, length = 20)
    public String getPmsAccountType() {
        return pmsAccountType;
    }

    public void setPmsAccountType(String pmsAccountType) {
        this.pmsAccountType = pmsAccountType;
    }

    @Basic
    @Column(name = "descript", nullable = true, length = 20)
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "descript_en", nullable = true, length = 20)
    public String getDescriptEn() {
        return descriptEn;
    }

    public void setDescriptEn(String descriptEn) {
        this.descriptEn = descriptEn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        L2RIpms2AccountType that = (L2RIpms2AccountType) o;

        if (hotelId != that.hotelId) return false;
        if (hotelGroupId != that.hotelGroupId) return false;
        if (l2RAccountType != null ? !l2RAccountType.equals(that.l2RAccountType) : that.l2RAccountType != null)
            return false;
        if (pmsAccountType != null ? !pmsAccountType.equals(that.pmsAccountType) : that.pmsAccountType != null)
            return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;
        if (descriptEn != null ? !descriptEn.equals(that.descriptEn) : that.descriptEn != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (hotelId ^ (hotelId >>> 32));
        result = 31 * result + (int) (hotelGroupId ^ (hotelGroupId >>> 32));
        result = 31 * result + (l2RAccountType != null ? l2RAccountType.hashCode() : 0);
        result = 31 * result + (pmsAccountType != null ? pmsAccountType.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        result = 31 * result + (descriptEn != null ? descriptEn.hashCode() : 0);
        return result;
    }
}
